package com.ylyl.springai01chatdeepseek.Controller;

import jakarta.annotation.Resource;
import org.springframework.ai.deepseek.DeepSeekChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeepSeekController {

    @Resource
    private DeepSeekChatModel deepSeekChatModel;

    @GetMapping("/chat")
    public String chat(@RequestParam(name = "question",defaultValue = "你是谁") String question){
        String result = deepSeekChatModel.call(question);
        System.out.println("result = " + result);
        return result;
    }
}
